/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pop3;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 *
 * @author epulapp
 */
public class ServerPOP {
    
    private final int port = 110;
    
    private ServerSocket ss;
    
    public ServerPOP() {
        try{
            this.ss = new ServerSocket(this.port);
        }catch (IOException ioe){
            System.err.println(ioe.getMessage());
        }
    }
    
    public void demarrer(){
        
        while(true){
            try {
                Socket s = ss.accept();
                Thread st = new Thread(new ThreadPOP(s));

                st.start();
            } catch (IOException ioe) {}
        }
    }
    
    public static void main (String [] args) {
        ServerPOP server = new ServerPOP();
        server.demarrer();
    }
    
}
